using System;
using System.Collections.Generic;

using TnPlus.Entities.Utils;
using TnPlus.Entities.Models;
using TnPlus.DAL;
using TnPlus.Common;

namespace TnPlus.Biz
{
	public class DebtTodayService
	{
		/// <summary>
		/// Saves a record to the DebtToday table.
		/// </summary>
		public virtual void Insert(DebtTodayInfo debtTodayInfo)
		{
			try
			{
				new DebtTodayDAO().Insert(debtTodayInfo);
			}
			catch (Exception ex)
			{
				Logger.Error("TnPlus.Biz.DebtToday - Insert", ex);
				throw;
			}

		}

		/// <summary>
		/// Saves a record to the DebtToday table.
		/// </summary>
		public virtual void Update(DebtTodayInfo debtTodayInfo)
		{
			try
			{
				new DebtTodayDAO().Update(debtTodayInfo);
			}
			catch (Exception ex)
			{
				Logger.Error("TnPlus.Biz.DebtToday - Update", ex);
				throw;
			}

		}

		/// <summary>
		/// Delete a record from the DebtToday table.
		/// </summary>
		public virtual void Delete(Guid? idDebt)
		{
			try
			{
				new DebtTodayDAO().Delete(idDebt);
			}
			catch (Exception ex)
			{
				Logger.Error("TnPlus.Biz.DebtToday - Delete", ex);
				throw;
			}

		}

		/// <summary>
		/// Selects a single record from the DebtToday table.
		/// </summary>
		public virtual DebtTodayInfo Select(Guid? idDebt)
		{
			try
			{
				return new DebtTodayDAO().Select(idDebt);
			}
			catch (Exception ex)
			{
				Logger.Error("TnPlus.Biz.DebtToday - Select", ex);
				throw;
			}

		}

		/// <summary>
		/// Selects all records from the DebtToday table.
		/// </summary>
		public List<DebtTodayInfo> SelectAll()
		{
			try
			{
				return new DebtTodayDAO().SelectAll();
			}
			catch (Exception ex)
			{
				Logger.Error("TnPlus.Biz.DebtToday - SelectAll", ex);
				throw;
			}

		}

	}
}
